import { createBrowserRouter } from "react-router-dom";
import Layout from "../components/Layout";
import Home from "../components/home";
import My from "../components/My";
import My1 from "../components/My1";
import My2 from "../components/My2";
import A404 from "../components/404";
const router = createBrowserRouter([
  // 一级路由
  {
    // 二级路由
    path: "/",
    element: <Layout />,
    children: [
      // 三级路由
      {
        path: "My",
        element: <My />,
        children: [
          // 四级路由
          {
            // 配置子默认路由
            index: true,
            element: <My1 />,
          },
          {
            path: "My2",
            element: <My2 />,
          },
        ],
      },
      {
        index: true,
        element: <Home />,
      },
    ],
  },
  {
    path: "*",
    element: <A404 />,
  },
]);
export default router;
